import java.util.List;

/**
 * @ClassName Test
 * @Description TODO
 * @Author ZJX
 * @Date 2024/7/23 9:24
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();

//       递归三种遍历
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();

        System.out.println("节点个数: " + binaryTree.size(root));
        System.out.println("叶子节点个数: " + binaryTree.getLeafNodeCount(root));
        System.out.println("叶子节点个数: " + binaryTree.getLeafNodeCount1(root));
        System.out.println("获取第k层的节点数: " + binaryTree.getKLevelNodeCount(root, 4));

        System.out.println("树的高度: " + binaryTree.getHeight(root));
        System.out.println(binaryTree.find(root, 'E'));

        binaryTree.levelOrder(root);
        binaryTree.isCompleteTree(root);

        List<Integer> inorderResult = binaryTree.inorderTraversalIterative(root);
    }
}
